package com.blog.config.mvc;

import com.blog.interceptor.BaseInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Web Mvc配置类
 *
 * @author wmb
 *
 * @since 2021-2-7
 */
@Component
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    @Qualifier("baseInterceptor")
    private BaseInterceptor baseInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(baseInterceptor);
    }

}
